<template>
  <view class="function-grid" :class="gridClass">
    <slot></slot>
  </view>
</template>

<script setup lang="ts">
// 定义props
const props = defineProps({
  columns: {
    type: Number,
    default: 4
  }
});

// 计算网格类
const gridClass = computed(() => {
  return `grid-cols-${props.columns}`;
});

import { computed } from 'vue';
</script>

<style lang="scss" scoped>
.function-grid {
  display: grid;
  gap: 20rpx;
  background-color: white;
  border-radius: 24rpx;
  padding: 30rpx;
  box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
}

.grid-cols-4 {
  grid-template-columns: repeat(4, 1fr);
}

.grid-cols-5 {
  grid-template-columns: repeat(5, 1fr);
}
</style> 